<?php
/**
 * Created by PhpStorm.
 * User: bzg
 * Date: 2019/11/27
 * Time: 14:53
 */

namespace App\Extend\SysExtend\Middleware;

use EasySwoole\Http\Request;
use EasySwoole\Http\Response;

/**
 * 中间件接口,所有的中间件必须实现这个接口
 * Interface MiddlewareInterface
 * @package App\Extend\Middleware
 */
interface MiddlewareInterface
{
    /**
     * 控制方法执行前执行的方法
     * @param Request $request
     * @param Response $response
     * @return mixed
     */
    public function before(Request $request, Response $response);


    /**
     * 控制方法执行后执行的方法
     * @param Request $request
     * @param Response $response
     * @return mixed
     */
    public function after(Request $request, Response $response);
}